import { Body, Controller, Get, Query } from "@nestjs/common";
import { ApiOperation, ApiTags } from "@nestjs/swagger";
import { CardDataDto, HotelListDto, OptionOccupancyDto } from "../dto/visualDto";
import { VisualService } from "../service/visual.service";
/* 
控制层只负责调用服务，所有的业务代码应写在VisualService中

*/
@ApiTags("visual - 可视化模块")
@Controller("visual")
export class VisualController {
    constructor(
        private readonly visualService: VisualService,
    ) { }

    @Get("test")
    @ApiOperation({
        summary: "测试数据库是否连接成功",
    })
    async test() {
        return await this.visualService.test();
    }


    @Get("/insert_card_for_power")
    @ApiOperation({
        summary: "插卡取电",
    })
    async insertCardForPower(@Query('leftTime') leftTime: string, @Query('rightTime') rightTime: string) {
        return await this.visualService.insert_card_for_power(leftTime, rightTime);
    }


    @Get("/settlement")
    @ApiOperation({
        summary: "根据时间段查询在合同内的酒店信息，结算",
    })
    async getHotelDailySettel(@Query('leftTime') leftTime: string, @Query('rightTime') rightTime: string) {
        return await this.visualService.get_hotel_daily_settel(leftTime, rightTime);
    }

    //根据酒店名或Id获取所有房间卡 未找到方法
    @Get("/hotel")
    @ApiOperation({
        summary: "根据酒店名或Id获取所有房间卡 未找到方法 不可用",
    })
    async getCardListdOfHotel() {
        return true;
    }

    //合同内酒店数据
    @ApiOperation({
        summary: "合同内酒店数据",
    })
    @Get("/rent_number")
    async rentHotelData() {
        return await this.visualService.rent_hotel_data();
    }

    //总入住率
    @ApiOperation({
        summary: "总入住率数据",
    })
    @Get("/occupancy_rate")
    async occupancyRate() {
        return await this.visualService.occupancy_rate();
    }

    //酒店租金数据
    @Get("/rental_dealing")
    async rentalDealing() {

    }

    //各项数据排行榜
    @Get("/ranking_list")
    async rankingList() {

    }

    //入住和租金展示，租金部分待修改
    @Get("/occupancy_rental")
    async occupancyRental(@Query('leftTime') leftTime: string, @Query('rightTime') rightTime: string) {

    }

    ////任务2入住和租金展示,收租部分
    @Get("/occupancy_rental2")
    async occupancyRental2(@Query('leftTime') leftTime: string, @Query('rightTime') rightTime: string) {

    }

    //任务2 安装房间部分部分
    @Get("/install_room")
    async installRoom(@Query('leftTime') leftTime: string, @Query('rightTime') rightTime: string) {

    }

    //任务3酒店列表综述
    @Get("/hotel_list_show")
    async hotelListShow(@Body() hotelList: HotelListDto[]) {

    }

    //酒店综述
    @Get("/rent_hotel_data")
    async rentHotelData2() {

    }
    //总入住率
    @Get("/option_occupancyAll")
    async optionOccupancyAll(@Body() hotelList: HotelListDto[]) {

    }
    //总收租
    @Get("/option_rental_dealing")
    async allAentalDealing(@Body() hotelList: HotelListDto[]) {

    }
    //选中酒店入住
    @Get("/option_occupancy")
    async optionOccupany(@Body() optionOccupancy: OptionOccupancyDto) {

    }

    //酒店各项数据占比
    @Get("/hotel_data_proportion")
    async hotelDataProportion(@Body() optionOccupancy: OptionOccupancyDto) {

    }

    //任务4各酒店插卡取电详情
    @Get("/insert_valid_invalid")
    async insertValidIncalid(@Body() optionOccupancy: OptionOccupancyDto) {

    }

    //任务4各酒店插卡取电详情
    @Get("/read_invalid")
    async readInvalid(@Body() optionOccupancy: OptionOccupancyDto) {

    }

    //任务4插卡有效加无效详情
    @Get("/read_invalid2")
    async readInvalid2(@Body() optionOccupancy: OptionOccupancyDto) {

    }

    //根据酒店房间regiId和时间查询插卡次数和持续时间
    @Get("/card_data")
    async cardData(@Body() cardData: CardDataDto) {

    }


}